﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MTQ.Common
{

    public class LogManager
    {
        public static log4net.ILog DebugFileLogger;
        public static log4net.ILog ErrorFileLogger;
        static LogManager()
        {
            DebugFileLogger = log4net.LogManager.Exists("LogDebugFile");
            ErrorFileLogger = log4net.LogManager.Exists("LogErrorFile");
        }
        /// <summary>
        /// 写入日志文件
        /// </summary>
        /// <param name="message"></param>
        public static void WriteLog(string message)
        {
            DebugFileLogger?.Debug(message);
        }
        /// <summary>
        /// 写入日志文件
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        public static void WriteLog(string message, Exception ex)
        {
            ErrorFileLogger?.Error(message, ex);
        }
    }
}
